package com.kly.smartbi.test.day05;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Scanner;

/**
 * @author admin
 * @date 2025/4/7
 */
public class Demo1 {

    public static void main(String[] args) {
        arraySort();
    }

    /**
     * 排序字母
     */
    public static void sortLetter() {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        String str = scan.next();
        char[] chars = str.toCharArray();
        Arrays.sort(chars);
        System.out.println(new String(chars));
        scan.close();
    }

    /**
     * 数组排序
     */
    public static void arraySort() {
        Integer[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

        Arrays.sort(arr, (a, b) -> b - a);
        for (Integer integer : arr) {
            System.out.print(integer + " ");
        }
    }

    /**
     * 时间显示
     */
    public static void timeDisplay() {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        long timeStr = scan.nextLong();
        Date date = new Date(timeStr);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
        String format = simpleDateFormat.format(date);
        System.out.println(format);
        scan.close();
    }

    /**
     * 购物单
     */
    public static void shoppingList() {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            String str = scan.next();
            double price = scan.nextDouble();
            String discount = scan.next();
        }
    }
}
